﻿var manNum = 500;
var womanNum = 5000;

var rotateAngle = (manNum) / 2 / (manNum + womanNum) * 360 + 180;



var data = [{
    value: manNum,
    name: '男'
}, {

    value: womanNum,
    name: '女'
}]
var rich = {
    man: {
        align: 'center',
        padding: [20, 0, 0, 0],
        backgroundColor: {
            image: ''
        }
    },
    woman: {
        align: 'center',
        padding: [20, 0, 0, 0],
        backgroundColor: {
            image: ''
        }
    },
    yellow: {
        color: "#ffc72b",
        fontSize: 34,
        padding: [5, 4],

    },
    blue: {
        color: '#49dff0',
        fontSize: 16,
        align: 'center'
    },
    hr: {
        borderColor: '#0b5263',
        width: '100%',
        borderWidth: 1,
        height: 0,
    }
}




option = option = {
    backgroundColor: '#031f2d',
    tooltip: {
        show: true,
        trigger: 'item',
        formatter: "{b} : {c} 人 <br/>占比:{d}%"
    },
    series: [{
        name: '',
        /*minAngle: 180,*/
        startAngle: rotateAngle,
        type: 'pie',
        radius: ['50%', '70%'],
        center: ['35%', '50%'],
        avoidLabelOverlap: false,
        label: {
            normal: {
                show: true,
                position: 'left',
                formatter: function(params, ticket, callback) {
                    var a = params.name === '男' ? '{man|}' : '{woman|}';
                    return a + '\n{blue|' + params.percent + '%}';
                },
                rich: rich
            },
            emphasis: {
                show: true,
                formatter: null,
                textStyle: {
                    color: '#fff',
                    fontSize: '12',
                    fontWeight: 'bold'
                }
            }
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data: data
    }],
    color: ['#707db2', '#ff7487'],

    animation: true,
    animationThreshold: 2500,
    addDataAnimation: true,
    animationDuration: 2000,
    animationEasing: 'ExponentialOut'
};
